<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS对象BOM</title>
</head>
<body>
    
</body>
<script>

    // window对象
    // 警告框
    alert("hello BOM")
    //确认框
    var flag = confirm("你确定吗")
    alert(flag)
    //周期性执行函数
    var i=0;
    setInterval(function(){
        console.log("定时器执行了"+i+"次");
        i++;
    },2000);

    //延时执行一次
    setTimeout(function() {
        alert("Time");
    },2000);


    // location对象
    // 设置或返回url
    console.log(location.href);
    setTimeout(function(){
        location.href = "https://www.baidu.com"
    },2000)

    
    
</script>
</html>